﻿using System;
using UnityEngine;
using UnityEngine.UI;

namespace Studio
{
	// Token: 0x02000539 RID: 1337
	public class AddButtonCtrl : MonoBehaviour
	{
		// Token: 0x06002257 RID: 8791 RVA: 0x000CF640 File Offset: 0x000CD840
		public void OnClick(int _kind)
		{
			this.select = ((this.select != _kind) ? _kind : -1);
			for (int i = 0; i < this.commonInfo.Length; i++)
			{
				this.commonInfo[i].active = (i == this.select);
			}
			SortCanvas.select = this.canvas;
		}

		// Token: 0x06002258 RID: 8792 RVA: 0x000CF6A0 File Offset: 0x000CD8A0
		private void Start()
		{
			this.select = -1;
		}

		// Token: 0x0400236C RID: 9068
		[SerializeField]
		private AddButtonCtrl.CommonInfo[] commonInfo;

		// Token: 0x0400236D RID: 9069
		[SerializeField]
		private Canvas canvas;

		// Token: 0x0400236E RID: 9070
		private int select = -1;

		// Token: 0x0200053A RID: 1338
		[Serializable]
		private class CommonInfo
		{
			// Token: 0x17000430 RID: 1072
			// (set) Token: 0x0600225A RID: 8794 RVA: 0x000CF6B4 File Offset: 0x000CD8B4
			public bool active
			{
				set
				{
					if (this.obj.activeSelf != value)
					{
						this.obj.SetActive(value);
						this.button.image.color = ((!value) ? Color.white : Color.green);
					}
				}
			}

			// Token: 0x0400236F RID: 9071
			public GameObject obj;

			// Token: 0x04002370 RID: 9072
			public Button button;
		}
	}
}
